<!DOCTYPE html>
<html>
<head><title>参数配置</title>
<#include "../common/common.ftl"/>
    <link rel="stylesheet" href="/style/contractForm.css" media="all">
</head>
<body>
<div class="layui-fluid">
    <form class="layui-form" id="dataForm">
        <input type="hidden" name="parameterId" value="${(parameter.id)!}"/>
        <div class="layui-card">
            <div class="layui-card-header">一、参数配置基本信息</div>
            <div class="layui-card-body">
                <div class="layui-form-item">
                    <label class="layui-form-labelLong jmdf-color-red">参数名称：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                               lay-verify="required" name="name" value="${(parameter.name)!}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">参数备注：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off"
                                name="memo" value="${(parameter.memo)!}"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-card">
            <div class="layui-card-header">二、【住宅】参数配置【<span class="jmdf-color-red">除“过渡补助费单价”其余单位均为“元/㎡”</span>】</div>
            <div class="layui-card-body">
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">选房不足补偿单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="3855" name="xfbcPrice" value="${(parameter.xfbcPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">储物间申购单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="2000" name="cwjPrice" value="${(parameter.cwjPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">住宅维修基金标准单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="请根据楼层据实填写" name="zzwxPrice" value="${(parameter.zzwxPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">住宅维修基金本次单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="zzbcwxPrice" value="${(parameter.zzbcwxPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">储藏间维修基金标准单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="请根据楼层据实填写" name="ccjwxPrice" value="${(parameter.ccjwxPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">储藏间维修基金本次单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="ccjbcwxPrice" value="${(parameter.ccjbcwxPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">店面维修基金标准单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="90" name="dmwxPrice" value="${(parameter.dmwxPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">店面维修基金本次单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="90" name="dmbcwxPrice" value="${(parameter.dmbcwxPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">车位维修基金标准单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="50" name="cwwxPrice" value="${(parameter.cwwxPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">车位维修基金本次单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="50" name="cwbcwxPrice" value="${(parameter.cwbcwxPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">过渡补助费单价(<span class="jmdf-color-red">元/㎡/月</span>)</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="6" name="gdbzPrice" value="${(parameter.gdbzPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">储物间调换比例</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="1.9" name="cwjBl" value="${(parameter.cwjBl)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">可扩改建面单价(<span class="jmdf-color-red">元/㎡</span>)</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="kkgPrice" value="${(parameter.kkgPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">房屋公维金本次缴交比例</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="gwjHouseNowBl" value="${(parameter.gwjHouseNowBl)!}"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <#--住宅扩购部分-->
        <div class="layui-card">
            <div class="layui-card-header">三、【住宅】扩购面积区间及单价配置【<span class="jmdf-color-red">所有数据全部填写系统才会保存，否则自动删除!</span>】</div>
            <div class="layui-card-body">
                <table class="layui-table" id="overAreaTable">
                    <tr class="layui-bg-gray">
                        <th style="text-align: center;">最小面积(不含)<span class="jmdf-color-red">(㎡)</span></th>
                        <th style="text-align: center;">最大面积(含)<span class="jmdf-color-red">(㎡)</span></th>
                        <th style="text-align: center;">房源购买单价<span class="jmdf-color-red">(元)</span></th>
                        <th style="text-align: center;">排序号<br/><span class="jmdf-color-red">请按面积区间由小到大排序</span></th>
                    </tr>
                    <#if (overAreaPriceNewList?size == 0)>
                        <tr>
                            <td style="text-align: center;">
                                <input type="text" name="minArea" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="maxArea" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="price" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="sortNum" class="layui-input" value="" />
                            </td>
                        </tr>
                    <#else>
                        <#list overAreaPriceNewList as overAreaPriceNew>
                            <tr>
                                <td style="text-align: center;">
                                    <input type="text" name="minArea" class="layui-input" value="${(overAreaPriceNew.minArea)!}"/>
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="maxArea" class="layui-input" value="${(overAreaPriceNew.maxArea)!}" />
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="price" class="layui-input" value="${(overAreaPriceNew.price)!}"/>
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="sortNum" class="layui-input" value="${(overAreaPriceNew.sortNum)!}" />
                                </td>
                            </tr>
                        </#list>
                    </#if>
                </table>
                <div align="center"><input type="button" id="addRow" class="layui-btn" value="添加新行"/></div>
            </div>
        </div>

        <#--商业安置不足单价-->
        <div class="layui-card">
            <div class="layui-card-header">四、【商业】参数配置【<span class="jmdf-color-red">*正数扩购负数安置不足*</span>】</div>
            <div class="layui-card-body">
                <#--<div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">商业店面安置不足单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="syDmAzSyAzBzPrice" value="${(parameter.syDmAzSyAzBzPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">商业商场安置不足单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="syScAzSyAzBzPrice" value="${(parameter.syScAzSyAzBzPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                </div>-->
                <#--<div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">商业二层安置不足单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="syTwoFloorAzSyAzBzPrice" value="${(parameter.syTwoFloorAzSyAzBzPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">商业写字楼安置不足单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="syXzlAzSyAzBzPrice" value="${(parameter.syXzlAzSyAzBzPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                </div>-->
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong red">开间≤3.3米应缴款</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="kjYjMoney" value="${(parameter.kjYjMoney)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong red">跨街区安置应缴款</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="kqjYjMoney" value="${(parameter.kqjYjMoney)!}"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <#--一层商业扩购部分-->
        <div class="layui-card">
            <div class="layui-card-header">四、【商业】扩购面积及回购信息登记【<span class="jmdf-color-red">所有数据全部填写系统才会保存，否则自动删除!</span>】</div>
            <div class="layui-card-body">
                <table class="layui-table" id="overAreaOneFloorSyTable">
                    <tr class="layui-bg-gray">
                        <th style="text-align: center;">商业情况<span class="jmdf-color-red"></span></th>
                        <th style="text-align: center;">名称<span class="jmdf-color-red"></span></th>
                        <th style="text-align: center;">对应面积<span class="jmdf-color-red">(㎡)</span></th>
                        <th style="text-align: center;">对应单价<span class="jmdf-color-red">(元/㎡)</span></th>
                        <th style="text-align: center;">对应金额<span class="jmdf-color-red">(元)</span></th>
                        <th style="text-align: center;">排序号<br/><span class="jmdf-color-red">请按面积区间由小到大排序</span></th>
                        <th style="text-align: center;">原协议安置面积<span class="jmdf-color-red">(㎡)</span></th>
                    </tr>
                    <#if (syKgInfoList?size == 0)>
                        <tr>
                            <td style="text-align: center;">
                                <input type="text" name="syKgBuildHouseInfo" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="syKgKgName" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="syKgArea" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="syKgPrice" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="syKgMoney" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="syKgSortNum" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="syKgZsAzArea" class="layui-input" value="" />
                            </td>
                        </tr>
                    <#else>
                        <#list syKgInfoList as syKgInfo>
                            <tr>
                                <td style="text-align: center;">
                                    <input type="text" name="syKgBuildHouseInfo" class="layui-input" value="${(syKgInfo.buildHouseInfo)!}"/>
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="syKgKgName" class="layui-input" value="${(syKgInfo.kgName)!}" />
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="syKgArea" class="layui-input" value="${(syKgInfo.area)!}"/>
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="syKgPrice" class="layui-input" value="${(syKgInfo.price)!}" />
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="syKgMoney" class="layui-input" value="${(syKgInfo.money)!}" />
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="syKgSortNum" class="layui-input" value="${(syKgInfo.sortNum)!}" />
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="syKgZsAzArea" class="layui-input" value="${(syKgInfo.zsAzArea)!}" />
                                </td>
                            </tr>
                        </#list>
                    </#if>
                </table>
                <div align="center"><input type="button" id="oneFloorSyAddRow" class="layui-btn" value="添加新行"/></div>
            </div>
        </div>
        <button style="display: none;" class="layui-btn" id="submitBtn" name="submitBtn" lay-submit="" lay-filter="submit">立即提交</button>
    </form>
</div>
<script src="/layui/layui.js" charset="utf-8"></script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['form', "verify", "dataDict"], function () {
        var form = layui.form, $ = layui.jquery, verify = layui.verify,parentIndex = parent.layer.getFrameIndex(window.name);

        //增加新行
        $("#addRow").click(function () {
            var rowIndex = $("#overAreaTable tr").length - 1;
            $("#overAreaTable tr:last").clone().insertAfter($("#overAreaTable tr:eq(" + rowIndex + ")"));
            $("#overAreaTable tr:last input").each(function () {
                $(this).val("");
            });
            form.render();
        });

        //一层商业增加新行
        $("#oneFloorSyAddRow").click(function () {
            var rowIndex = $("#overAreaOneFloorSyTable tr").length - 1;
            $("#overAreaOneFloorSyTable tr:last").clone().insertAfter($("#overAreaOneFloorSyTable tr:eq(" + rowIndex + ")"));
            $("#overAreaOneFloorSyTable tr:last input").each(function () {
                $(this).val("");
            });
            form.render();
        });

        //二层商业增加新行
        $("#twoFloorSyAddRow").click(function () {
            var rowIndex = $("#overAreaTwoFloorSyTable tr").length - 1;
            $("#overAreaTwoFloorSyTable tr:last").clone().insertAfter($("#overAreaTwoFloorSyTable tr:eq(" + rowIndex + ")"));
            $("#overAreaTwoFloorSyTable tr:last input").each(function () {
                $(this).val("");
            });
            form.render();
        });

        //商场增加新行
        $("#scAddRow").click(function () {
            var rowIndex = $("#overAreaScTable tr").length - 1;
            $("#overAreaScTable tr:last").clone().insertAfter($("#overAreaScTable tr:eq(" + rowIndex + ")"));
            $("#overAreaScTable tr:last input").each(function () {
                $(this).val("");
            });
            form.render();
        });

        //写字楼增加新行
        $("#xzlAddRow").click(function () {
            var rowIndex = $("#overAreaXzlTable tr").length - 1;
            $("#overAreaXzlTable tr:last").clone().insertAfter($("#overAreaXzlTable tr:eq(" + rowIndex + ")"));
            $("#overAreaXzlTable tr:last input").each(function () {
                $(this).val("");
            });
            form.render();
        });
        //监听提交
        form.on('submit(submit)', function (data) {
            $.ajax({
                url: 'dataFormSave',
                type: 'post',
                data: $("#dataForm").serialize(),
                success: function (data) {
                    if (data.code == "0001") {
                        layer.alert(data.message);
                        parent.loadData();
                        parent.layer.close(parentIndex);
                    } else {
                        layer.msg(data.message, {anim: 6, icon: 2, time: 3000});
                    }
                }
            });
            return false;
        });

    });
</script>
</body>
</html>